\(\int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx\) [42]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 27 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i a^5}{2 d (a-i a \tan (c+d x))^2} \]

[Out]

-1/2*I*a^5/d/(a-I*a*tan(d*x+c))^2

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 32} \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i a^5}{2 d (a-i a \tan (c+d x))^2} \]

[In]

Int[Cos[c + d*x]^4*(a + I*a*Tan[c + d*x])^3,x]

[Out]

((-1/2*I)*a^5)/(d*(a - I*a*Tan[c + d*x])^2)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\left (i a^5\right ) \text {Subst}\left (\int \frac {1}{(a-x)^3} \, dx,x,i a \tan (c+d x)\right )}{d} \\ & = -\frac {i a^5}{2 d (a-i a \tan (c+d x))^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {i a^3}{2 d (i+\tan (c+d x))^2} \]

[In]

Integrate[Cos[c + d*x]^4*(a + I*a*Tan[c + d*x])^3,x]

[Out]

((I/2)*a^3)/(d*(I + Tan[c + d*x])^2)

Maple [A] (verified)

Time = 13.76 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.41

method result size
risch \(-\frac {i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}}{8 d}-\frac {i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{4 d}\) \(38\)
derivativedivides \(\frac {-\frac {i a^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4}-3 a^{3} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {3 i a^{3} \left (\cos ^{4}\left (d x +c \right )\right )}{4}+a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(114\)
default \(\frac {-\frac {i a^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4}-3 a^{3} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {3 i a^{3} \left (\cos ^{4}\left (d x +c \right )\right )}{4}+a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(114\)

[In]

int(cos(d*x+c)^4*(a+I*a*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

-1/8*I/d*a^3*exp(4*I*(d*x+c))-1/4*I/d*a^3*exp(2*I*(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.26 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=\frac {-i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )}}{8 \, d} \]

[In]

integrate(cos(d*x+c)^4*(a+I*a*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/8*(-I*a^3*e^(4*I*d*x + 4*I*c) - 2*I*a^3*e^(2*I*d*x + 2*I*c))/d

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 80 vs. \(2 (22) = 44\).

Time = 0.17 (sec) , antiderivative size = 80, normalized size of antiderivative = 2.96 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=\begin {cases} \frac {- 4 i a^{3} d e^{4 i c} e^{4 i d x} - 8 i a^{3} d e^{2 i c} e^{2 i d x}}{32 d^{2}} & \text {for}\: d^{2} \neq 0 \\x \left (\frac {a^{3} e^{4 i c}}{2} + \frac {a^{3} e^{2 i c}}{2}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)**4*(a+I*a*tan(d*x+c))**3,x)

[Out]

Piecewise(((-4*I*a**3*d*exp(4*I*c)*exp(4*I*d*x) - 8*I*a**3*d*exp(2*I*c)*exp(2*I*d*x))/(32*d**2), Ne(d**2, 0)),
 (x*(a**3*exp(4*I*c)/2 + a**3*exp(2*I*c)/2), True))

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (21) = 42\).

Time = 0.37 (sec) , antiderivative size = 57, normalized size of antiderivative = 2.11 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {-i \, a^{3} \tan \left (d x + c\right )^{2} - 2 \, a^{3} \tan \left (d x + c\right ) + i \, a^{3}}{2 \, {\left (\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1\right )} d} \]

[In]

integrate(cos(d*x+c)^4*(a+I*a*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(-I*a^3*tan(d*x + c)^2 - 2*a^3*tan(d*x + c) + I*a^3)/((tan(d*x + c)^4 + 2*tan(d*x + c)^2 + 1)*d)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (21) = 42\).

Time = 0.71 (sec) , antiderivative size = 135, normalized size of antiderivative = 5.00 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {i \, a^{3} e^{\left (12 i \, d x + 8 i \, c\right )} + 6 i \, a^{3} e^{\left (10 i \, d x + 6 i \, c\right )} + 14 i \, a^{3} e^{\left (8 i \, d x + 4 i \, c\right )} + 16 i \, a^{3} e^{\left (6 i \, d x + 2 i \, c\right )} + 2 i \, a^{3} e^{\left (2 i \, d x - 2 i \, c\right )} + 9 i \, a^{3} e^{\left (4 i \, d x\right )}}{8 \, {\left (d e^{\left (8 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 2 i \, c\right )} + 4 \, d e^{\left (2 i \, d x - 2 i \, c\right )} + 6 \, d e^{\left (4 i \, d x\right )} + d e^{\left (-4 i \, c\right )}\right )}} \]

[In]

integrate(cos(d*x+c)^4*(a+I*a*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/8*(I*a^3*e^(12*I*d*x + 8*I*c) + 6*I*a^3*e^(10*I*d*x + 6*I*c) + 14*I*a^3*e^(8*I*d*x + 4*I*c) + 16*I*a^3*e^(6
*I*d*x + 2*I*c) + 2*I*a^3*e^(2*I*d*x - 2*I*c) + 9*I*a^3*e^(4*I*d*x))/(d*e^(8*I*d*x + 4*I*c) + 4*d*e^(6*I*d*x +
 2*I*c) + 4*d*e^(2*I*d*x - 2*I*c) + 6*d*e^(4*I*d*x) + d*e^(-4*I*c))

Mupad [B] (verification not implemented)

Time = 3.94 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.33 \[ \int \cos ^4(c+d x) (a+i a \tan (c+d x))^3 \, dx=-\frac {a^3\,\left (\frac {{\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{c\,4{}\mathrm {i}+d\,x\,4{}\mathrm {i}}}{4}\right )\,1{}\mathrm {i}}{2\,d} \]

[In]

int(cos(c + d*x)^4*(a + a*tan(c + d*x)*1i)^3,x)

[Out]

-(a^3*(exp(c*2i + d*x*2i)/2 + exp(c*4i + d*x*4i)/4)*1i)/(2*d)